package cn.sumpu.app.guoguojie.domain;

import java.io.Serializable;
import java.util.Date;

import cn.sumpu.app.guoguojie.constant.Constellation;
import cn.sumpu.app.guoguojie.constant.FamilyRole;
import cn.sumpu.app.guoguojie.constant.Sex;
import cn.sumpu.app.guoguojie.util.DateUtil;

public class Member implements Serializable {

	private static final long serialVersionUID = -886691862938169559L;

	private Integer id;
	private String family;
	private String identifier;
	private String username;
	private String nickname;
	// 头像URL
	private String avatar;
	private String password;
	private String salt;
	private String email;
	private String mobilephone;
	private String role;
	private Boolean isHost;
	private Boolean isActive;
	private String activeCode;
	
	private String imageServer;
	private Date gmtCreated;
	private Date gmtModified;

	private String sex;
	private String birthday;
	private String constellation;

	public String getConstellation() {
		return constellation;
	}
	
	public String getConstellationLabel() {
		return Constellation.getLabelByValue(this.constellation);
	}

	public void setConstellation(String constellation) {
		this.constellation = constellation;
	}

	private Family familyObj;

	private Detail detail;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getFamily() {
		return family;
	}

	public void setFamily(String family) {
		this.family = family;
	}

	public String getIdentifier() {
		return identifier;
	}

	public void setIdentifier(String identifier) {
		this.identifier = identifier;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getMobilephone() {
		return mobilephone;
	}

	public void setMobilephone(String mobilephone) {
		this.mobilephone = mobilephone;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public Boolean getIsHost() {
		return isHost;
	}

	public void setIsHost(Boolean isHost) {
		this.isHost = isHost;
	}

	public Boolean getIsActive() {
		return isActive;
	}

	public void setIsActive(Boolean isActive) {
		this.isActive = isActive;
	}

	public Date getGmtCreated() {
		return gmtCreated;
	}

	public void setGmtCreated(Date gmtCreated) {
		this.gmtCreated = gmtCreated;
	}

	public Date getGmtModified() {
		return gmtModified;
	}

	public void setGmtModified(Date gmtModified) {
		this.gmtModified = gmtModified;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public Family getFamilyObj() {
		return familyObj;
	}

	public void setFamilyObj(Family familyObj) {
		this.familyObj = familyObj;
	}

	public Detail getDetail() {
		return detail;
	}

	public void setDetail(Detail detail) {
		this.detail = detail;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getBirthday() {
		return birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	public String getActiveCode() {
		return activeCode;
	}

	public void setActiveCode(String activeCode) {
		this.activeCode = activeCode;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getNickname() {
		return nickname;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getAvatar() {
		return avatar;
	}

	public int getAge() {
		return DateUtil.getAge(birthday);
	}

	public String getRoleLabel() {
		return FamilyRole.getLabelByValue(this.role);
	}
	
	public String getSexLabel(){
		return Sex.getLabelByValue(this.sex);
	}

	public String getImageServer() {
		return imageServer;
	}

	public void setImageServer(String imageServer) {
		this.imageServer = imageServer;
	}
	
}
